#include "coordinate.hpp"

Coordinate Coordinate::operator+(const Coordinate &coor)const noexcept{
	Coordinate c;
	c.x = coor.x + x;
	c.y = coor.y + y;
	return c;
}

Coordinate &Coordinate::operator+=(const Coordinate &coor)noexcept{
	x += coor.x;
	y += coor.y;
	return *this;
}

Coordinate Coordinate::operator-(const Coordinate &coor)const noexcept{
	Coordinate c;
	c.x = x - coor.x;
	c.y = y - coor.y;
	return c;
}

Coordinate &Coordinate::operator-=(const Coordinate &coor)noexcept{
	x -= coor.x;
	y -= coor.y;
	return *this;
}

Coordinate Coordinate::operator/(int num)const noexcept{
	Coordinate coor;
	coor.x = x / num;
	coor.y = y / num;
	return coor;
}

Coordinate &Coordinate::operator/=(int num)noexcept{
	x /= x;
	y /= y;
	return *this;
}

Coordinate Coordinate::operator*(int num)const noexcept{
	Coordinate coor;
	coor.x = x * num;
	coor.y = y * num;
	return coor;
}


Coordinate &Coordinate::operator*=(int num)noexcept{
	x *= num;
	y *= num;
	return *this;
}

int Coordinate::operator*(const Coordinate &coor)const noexcept{
	return x * coor.x + y * coor.y;
}

bool Coordinate::operator==(const Coordinate &coor)const noexcept{
	return x == coor.x && y == coor.y;
}

bool Coordinate::operator!=(const Coordinate &coor)const noexcept{
	return x != coor.x || y != coor.y;
}
